<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>商家页</title>
<!-- CSS 
    ========================= -->
<!--bootstrap min css-->
<link rel="stylesheet"
	href="https://www.jq22.com/jquery/bootstrap-4.2.1.css">
<!--owl carousel min css-->
<link rel="stylesheet" href="assets/css/owl.carousel.min.css">
<!--slick min css-->
<link rel="stylesheet" href="assets/css/slick.css">
<!--magnific popup min css-->
<link rel="stylesheet" href="assets/css/magnific-popup.css">
<!--font awesome css-->
<link rel="stylesheet"
	href="https://www.jq22.com/jquery/font-awesome.4.7.0.css">
<!--ionicons css-->
<link rel="stylesheet" href="assets/css/ionicons.min.css">
<!--linearicons css-->
<link rel="stylesheet" href="assets/css/linearicons.css">
<!--animate css-->
<link rel="stylesheet" href="assets/css/animate.css">
<!--jquery ui min css-->
<link rel="stylesheet" href="assets/css/jquery-ui.min.css">
<!--slinky menu css-->
<link rel="stylesheet" href="assets/css/slinky.menu.css">
<!--plugins css-->
<link rel="stylesheet" href="assets/css/plugins.css">

<!-- Main Style CSS -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- 引入layui.js文件 -->
<link rel="stylesheet" href="layui/css/layui.css" media="all">
<!--modernizr min js here-->
<script src="assets/js/vendor/modernizr-3.7.1.min.js"></script>


</head>
<body>
	<% String path = "${pageContext.request.contextPath}"; %>
	<c:if test="${pData==null}">
		<c:redirect url="FoodsServlet?op=doSelectPageByStore"></c:redirect>
	</c:if>
	<jsp:include page="head.jsp"></jsp:include>
	<!--header area end-->

	<!--breadcrumbs area start-->
	<div class="breadcrumbs_area">
		<div class="container">
			<div class="row">
				<div class="col-12">
					<div class="breadcrumb_content">
						<h3>${store }</h3>

					</div>
				</div>
			</div>
		</div>
	</div>
	<!--breadcrumbs area end-->

	<!--shop  area start-->
	 <div class="shop_area shop_fullwidth mt-70 mb-70">
        <div class="container">
            <div class="row">
                <div class="col-12">
                    <!--shop wrapper start-->
                    <!--shop toolbar start-->
                    <div class="shop_toolbar_wrapper">
                        
                        <div class=" niceselect_option">
						<div class="page_amount">
							
						</div>
					</div>
					<!--shop toolbar end-->
					<div class="row shop_wrapper grid_list">
						<div class="col-12 ">
                               
							<c:if test="${pData==null}">
								<c:redirect url="FoodsServlet?op=selectByPage"></c:redirect>
							</c:if>
							 
							<c:if test="${pData!=null}">
								<c:forEach items="${pData.data}" var="foods">
									<table border="0px" cellspacing="0px" cellpadding="0px" >
									<tr><td>
									<div class="single_product">
										<div class="product_thumb"></div>
										
										 <a
											class="secondary_img" href="FoodsServlet?op=doSelectByFoodsid&foodsid=${foods.foodsid }"><img
											src="${foods.img}" alt=""></a>
											</td><td>
										<div class="product_content list_content">
											<h4 class="product_name">
												<a href="FoodsServlet?op=doSelectByFoodsid&foodsid=${foods.foodsid }" >${foods.foodsname}</a>
											</h4>

											<div class="price_box">
												<span class="current_price" >${foods.price}</span>
											</div>
											<div class="product_desc">
												<p>${foods.foodsstatus}</p>
												<p>&nbsp;</p>
												<div class="action_links list_action_right">
													<ul>
													
														<li class="add_to_cart">
														<form action="OrderdetailServlet?op=addFoodsToCart" method="post">
	                        <input type="hidden" name="foodname" id="foodname" value="${foods.foodsname}" />	
	                        <input type="hidden" name="foodsid" id="foodsid" value="${foods.foodsid}" />	
	                         <div class="order_button">  <button type="submit" style="border:0px;">添加到购物车</button></div>
	                         	 <!-- <input type="submit"  id="foodprice" value="添加到购物车"  class="primary_img"/>	 -->									
														<!-- <a href="CartServlet?op=addcart"
															title="Add to cart" id="change">添加到购物车</a> -->
														</form>	
														</li>

													</ul>
												</div>
											</div>
										</div>
										</td>
									
									</tr>
									</table>
								</c:forEach>
							</c:if>
                         

						</div>
	</div>
					</div>
					<!-- 显示 分页导航区域 -->
					<div id="pagediv" style="text-align: center;"></div>
					<!--shop toolbar end-->
					<!--shop wrapper end-->
				</div>
			</div>

		</div>
	</div>
	<!--shop  area end-->

	<!--footer area start-->
	<jsp:include page="footer.jsp"></jsp:include>
	<!-- 引入layui.js文件 -->
	<script src="layui/layui.js" charset="utf-8"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
	function delfun(){
		
			location.href="http://localhost:8080/eeday03/Nt?typeid="+typeid;
		
	}

	</script>
	<script>
      layui.use(['laypage', 'layer'], function(){
       var laypage = layui.laypage
      ,layer = layui.layer;
       
       
     //完整功能
       laypage.render({
         elem: 'pagediv'
         ,count:${pd.totalCount}
         ,curr:${pd.page}

         , limit:${pd.pageSize}
         ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
         ,jump: function(obj,first){
        	    //obj包含了当前分页的所有参数，比如：
        	    console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
        	    console.log(obj.limit); //得到每页显示的条数
        	    
        	    //首次不执行
        	    if(!first){
        	     //do something
        	    location.href="FoodsServlet?op=selectByPage&page="+obj.curr+"&pageSize="+obj.limit+"&=keywords"+$("#keywords").val();
        	    } 
        	  }
         
       });
     
     
      
     
      });
       </script>
</body>
</html>